<?php $get_params=$this->request->params['controller'].'/'.$this->request->params['action'].'/'.$params; 
$get_params_none=$this->request->params['controller'];
?>

<div class="header-function">
    <ul>
      <li class="<?php echo (!empty($this->params['action']) && ($get_params=='posts/adsadd/') )?'active' :'' ?>">
          <?php
          $userdata = $this->session->read('Auth.User.id');
              echo $this->Html->link('Post Free Ads', array('controller' => 'posts', 'action' => 'adsadd'));
          ?>
      </li>
        <li class="<?php echo (!empty($this->params['action']) && ($get_params=='posts/manageads/') )?'active' :'' ?>">
          <?php
              echo $this->Html->link('Manage Ads', array('controller' => 'posts', 'action' => 'manageads'));
          ?>
        </li>
        <li class="<?php echo (!empty($this->params['action']) && ($get_params=='posts/edituser/') )?'active' :'' ?>">
          <?php
              echo $this->Html->link('Profile', array('controller' => 'posts', 'action' => 'edituser', $userdata));
          ?>
        </li>
    </ul>
  </div>